{% extends "common/layout_main.html" %}
{% block content %}
{% include "common/tab_member.html" %}
<div class="row">
    <div class="col-lg-12">
        <form class="form-inline wrap_search">
            <div class="row  m-t p-w-m">
                <div class="form-group">
                    <select name="status" class="form-control inline">
                        <option value="-1">请选择状态</option>
                        {% for item in status_mapping %}
                            <option value="{{ item }}" {% if item == resp['status'] %} selected {% endif %}>{{ status_mapping[item] }}</option>
                        {%  endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <select name="food" class="form-control inline">
                        <option value="-1">请选择状态</option>
                        {% for item in foods %}
                            <option value="{{ item.id }}" {% if resp['food_id'] == item.id %} selected {% endif %}>{{ item.name }}</option>
                        {%  endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <select name="score" class="form-control inline">
                        <option value="-1">请选择状态</option>
                        {% for item in score_select %}
                            <option value="{{ item }}" {% if item == resp['score'] %} selected {% endif %}>{{ score_select[item] }}</option>
                        {%  endfor %}
                    </select>
                </div>
            </div>
            <hr>
        </form>
        <table class="table table-bordered m-t">
            <thead>
            <tr>
                <th>头像</th>
                <th>姓名</th>
                <th>美餐</th>
                <th>评论内容</th>
                <th>打分</th>
            </tr>
            </thead>
            <tbody>
            {%  if pagination %}
                {% for item in pagination.items %}
            <tr>
                <td>
                    <img alt="image" class="img-circle" src="{{ item.member_info.avatar }}" style="width: 40px;height: 40px;">
                </td>
                <td>{{ item.member_info.nickname }}</td>
                <td>{{ item.foods_str }}</td>
                <td>{{ item.content }}</td>
                <td>{{ item.score }}</td>
            </tr>
             {% endfor %}
            {% else %}
                <tr><td colspan="5">暂无数据</td></tr>
            {% endif %}
            </tbody>
        </table>
        <!--分页代码已被封装到统一模板文件中-->
        {% include 'common/pagenation.html' %}
    </div>
</div>
{% endblock %}
{% block js %}
<script src="{{ url_for('static', filename='js/member/comment.js') }}"></script>
{% endblock %}